﻿<UserControl
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:Microsoft_Windows_Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero" x:Class="OrganizeYourSearch.VerticalPlacementTabControl" 
             mc:Ignorable="d" 
             d:DesignHeight="300">
	<UserControl.Resources>
		<Style x:Key="ButtonFocusVisual">
			<Setter Property="Control.Template">
				<Setter.Value>
					<ControlTemplate>
						<Rectangle Margin="2" SnapsToDevicePixels="true" Stroke="Black" StrokeThickness="1" StrokeDashArray="1 2"/>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
		<LinearGradientBrush x:Key="ButtonNormalBackground" EndPoint="0,1" StartPoint="0,0">
			<GradientStop Color="#F3F3F3" Offset="0"/>
			<GradientStop Color="#EBEBEB" Offset="0.5"/>
			<GradientStop Color="#DDDDDD" Offset="0.5"/>
			<GradientStop Color="#CDCDCD" Offset="1"/>
		</LinearGradientBrush>
		<SolidColorBrush x:Key="ButtonNormalBorder" Color="#FF707070"/>
		<Style x:Key="MinimizeTab" TargetType="{x:Type Button}">
			<Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
			<Setter Property="Background" Value="{StaticResource ButtonNormalBackground}"/>
			<Setter Property="BorderBrush" Value="{StaticResource ButtonNormalBorder}"/>
			<Setter Property="BorderThickness" Value="1"/>
			<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
			<Setter Property="HorizontalContentAlignment" Value="Center"/>
			<Setter Property="VerticalContentAlignment" Value="Center"/>
			<Setter Property="Padding" Value="1"/>
			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate TargetType="{x:Type Button}">
						<Microsoft_Windows_Themes:ButtonChrome x:Name="Chrome" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" RenderMouseOver="{TemplateBinding IsMouseOver}" RenderPressed="{TemplateBinding IsPressed}" RenderDefaulted="{TemplateBinding IsDefaulted}" SnapsToDevicePixels="true" Width="15.208" Height="13.292">
							<Path Data="M11.874667,3 L12.374333,10.166667 -56.865129,6.0976258 z" Fill="#FFBDC4D2" HorizontalAlignment="Stretch" Margin="1.458,1.125,2.645,1.062" Stretch="Fill" Stroke="#FF707070" Width="Auto"/>
						</Microsoft_Windows_Themes:ButtonChrome>
						<ControlTemplate.Triggers>
							<Trigger Property="IsKeyboardFocused" Value="true">
								<Setter Property="RenderDefaulted" TargetName="Chrome" Value="true"/>
							</Trigger>
							<Trigger Property="ToggleButton.IsChecked" Value="true">
								<Setter Property="RenderPressed" TargetName="Chrome" Value="true"/>
							</Trigger>
							<Trigger Property="IsEnabled" Value="false">
								<Setter Property="Foreground" Value="#ADADAD"/>
							</Trigger>
						</ControlTemplate.Triggers>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>
	</UserControl.Resources>
    <Grid>
        <Grid.Resources>

            <!-- TABCONTROL: Style -->
            <Style  TargetType="{x:Type TabControl}">
                <Setter Property="OverridesDefaultStyle" Value="True" />
                <Setter Property="SnapsToDevicePixels" Value="True" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type TabControl}">
                            <Grid KeyboardNavigation.TabNavigation="Local">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <StackPanel
                          x:Name="HeaderPanel"
                          Grid.Column="0"
                          Panel.ZIndex="1"
                          Margin="0,0,0,0"
                          IsItemsHost="True"
                          KeyboardNavigation.TabIndex="1"
                          Background="Transparent" />
                                <Border
                          x:Name="Border"
                          Grid.Column="1"
                          Background="white"
                          BorderBrush="lightgray"
                          BorderThickness="1"
                          CornerRadius="2"
                          KeyboardNavigation.TabNavigation="Local"
                          KeyboardNavigation.DirectionalNavigation="Contained"
                          KeyboardNavigation.TabIndex="2" >
                                    <ContentPresenter
                              x:Name="PART_SelectedContentHost"
                              Margin="4"
                              ContentSource="SelectedContent" />
                                </Border>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsEnabled" Value="False">
                                    <Setter Property="Foreground" Value="red" />
                                    <Setter TargetName="Border" Property="BorderBrush" Value="blue" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <!-- TAB ITEM: Brushes -->
            <LinearGradientBrush x:Key="TabItemBrush_Off" EndPoint="1,0.5" StartPoint="0,0.5">
                <GradientStop Color="#FFFFFFFF" Offset="0.435"/>
                <GradientStop Color="#FFE0E1E3" Offset="0.669"/>
            </LinearGradientBrush>

            <!-- TAB ITEM: Style-->
            <Style TargetType="{x:Type TabItem}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type TabItem}">
                            <Grid>
                                <Border
                          x:Name="Border"
                          Margin="4,0,0,0"
                          Background="{StaticResource TabItemBrush_Off}"
                          BorderBrush="LightGray"
                          BorderThickness="1,1,1,1"
                          CornerRadius="4,0,0,4" >
                                    <ContentPresenter x:Name="ContentSite"
                              VerticalAlignment="Center"
                              HorizontalAlignment="Center"
                              ContentSource="Header"
                              Margin="2,2,2,2"
                              RecognizesAccessKey="True"/>
                                </Border>
                            </Grid>
                            <ControlTemplate.Triggers>
                                <Trigger Property="IsSelected" Value="True">
                                    <Setter Property="Panel.ZIndex" Value="100" />
                                    <Setter TargetName="Border" Property="Background" Value="White" />
                                    <Setter TargetName="Border" Property="BorderThickness" Value="1,1,0,1" />
                                </Trigger>
                                <Trigger Property="IsEnabled" Value="False">
                                    <Setter TargetName="Border" Property="Background" Value="lightgray" />
                                    <Setter TargetName="Border" Property="BorderBrush" Value="orange" />
                                    <Setter Property="Foreground" Value="royalblue" />
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>	
            </Style>
 
        </Grid.Resources>

            <TabControl Height="Auto" x:Name="vertTbControl" HorizontalAlignment="Left" Width="230">
                <TabItem Header="Bookmark" x:Name="tbBookmark" MouseLeftButtonUp="tab_MouseLeftButtonUp">
                <StackPanel>
                    <WrapPanel Margin="0,0,-0.001,4" Orientation="Horizontal" d:LayoutOverrides="Width">
                		<TextBlock TextWrapping="Wrap" Text="  Bookmark" Width="140"/>
                		<Button Style="{StaticResource MinimizeTab}" Name="btnBookmark" Click="btn_Click" />
                	</WrapPanel>
                    <TreeView x:Name="tviewBookmark" HorizontalAlignment="Left" Height="Auto" Width="153" BorderBrush="{x:Null}" />
                </StackPanel>
            </TabItem>
            <TabItem Header="Comment" x:Name="tbComment" MouseLeftButtonUp="tab_MouseLeftButtonUp">
            	<StackPanel>
            		<WrapPanel Margin="0,0,-0.001,4" Orientation="Horizontal" d:LayoutOverrides="Width">
                		<TextBlock TextWrapping="Wrap" Text="  Comment" Width="138"/>
                		<Button Style="{StaticResource MinimizeTab}" Name="btnComment" Click="btn_Click" />
                	</WrapPanel>  
					<ListBox x:Name="lbComment" HorizontalAlignment="Left" Width="153" BorderBrush="{x:Null}" />      	
				</StackPanel>
                
            </TabItem>
            <TabItem Header="Highlight" MouseLeftButtonUp="tab_MouseLeftButtonUp">
                <StackPanel>
            		<WrapPanel Margin="0,0,-0.001,4" Orientation="Horizontal" d:LayoutOverrides="Width">
                		<TextBlock TextWrapping="Wrap" Text="  Highlight" Width="140"/>
                        <Button Style="{StaticResource MinimizeTab}" Name="btnHighlight" Click="btn_Click"/>
                	</WrapPanel>  
					<ListBox x:Name="lbHighlight" HorizontalAlignment="Left" Width="153" BorderBrush="{x:Null}" />      	
				</StackPanel>
            </TabItem>
            <TabItem Header="Important" MouseLeftButtonUp="tab_MouseLeftButtonUp">
                <StackPanel>
            		<WrapPanel Margin="0,0,-0.001,4" Orientation="Horizontal" d:LayoutOverrides="Width">
                		<TextBlock TextWrapping="Wrap" Text="  Important" Width="140"/>
                        <Button Style="{StaticResource MinimizeTab}" Name="btnImportant" Click="btn_Click"/>
                	</WrapPanel>  
					<ListBox x:Name="lbImportant" HorizontalAlignment="Left" Width="153" BorderBrush="{x:Null}" />      	
				</StackPanel>
            </TabItem>
            <TabItem Header="Question" MouseLeftButtonUp="tab_MouseLeftButtonUp">
                <StackPanel>
            		<WrapPanel Margin="0,0,-0.001,4" Orientation="Horizontal" d:LayoutOverrides="Width">
                		<TextBlock TextWrapping="Wrap" Text="  Question" Width="140"/>
                        <Button Style="{StaticResource MinimizeTab}" Name="btnQuestion" Click="btn_Click"/>
                	</WrapPanel>  
					<ListBox x:Name="lbQuestion" HorizontalAlignment="Left" Width="153" BorderBrush="{x:Null}" />      	
				</StackPanel>
            </TabItem>
         </TabControl>
    </Grid>
</UserControl>
	